<?php namespace Phpcmf\Controllers\Member;

class Tongji extends \Phpcmf\Member\Module
{


	public function shouru() {
		// 圈子收入
	    $uid = (int)\Phpcmf\Service::L('input')->get('uid');
		// 统计 uid 下所有的收入。1_quan_buy表里面的price 字段的总和
		$shouru_0 = \Phpcmf\Service::M()->db->table('1_quan_buy')->selectSum('price', 'total')->where('uid', $uid)->where('DATEDIFF(FROM_UNIXTIME(inputtime), NOW()) =', 0)->get()->getRow()->total;
		if($shouru_0){
			$shouru_0 = number_format($shouru_0, 2);
		}else{
			$shouru_0 = '0.00';
		}
		$data = [
			'shouru' => $shouru_0,
		];
		$this->_json('1', '查询成功', $data);
	}

}
